home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / IC++ 1.0b2 / CInternetConfig.h < prev    next >
Text File  |  1996-05-27  |  6KB  |  142 lines

  1. /***********************************************************************\
  2.     CInternetConfig.h
  3.     
  4.     A C++ class for using Internet Config
  5.     
  6.     by Dan Crevier
  7.     
  8.     version 1.1
  9.  
  10. \***********************************************************************/
  11.  
  12. #ifndef __ICTYPES__
  13. #include "ICTypes.h"
  14. #endif
  15.  
  16. #ifndef __ICAPI__
  17. #include "ICAPI.h"
  18. #endif
  19.  
  20. class CInternetConfig
  21. {
  22.     public:
  23.         CInternetConfig(OSType appSig);
  24.         virtual ~CInternetConfig();
  25.  
  26.         ICError Start(FSSpec *prefFile = NULL);
  27.         ICError Stop();
  28.  
  29.         Boolean ICComponentInstalled() { return installed; };
  30.  
  31.         ICError DoURL(StringPtr theURL);
  32.         
  33.         // preferences that return strings
  34.         ICError GetRealName(StringPtr result)
  35.             { return GetKeysString(kICRealName, result); };
  36.         ICError GetEmailAddress(StringPtr result)
  37.             { return GetKeysString(kICEmail, result); };
  38.         ICError GetMailAccount(StringPtr result)
  39.             { return GetKeysString(kICMailAccount, result); };
  40.         ICError GetMailPassword(StringPtr result)
  41.             { return GetKeysString(kICMailPassword, result); };
  42.         ICError GetNewsAuthUsername(StringPtr result)
  43.             { return GetKeysString(kICNewsAuthUsername, result); };
  44.         ICError GetNewsAuthPassword(StringPtr result)
  45.             { return GetKeysString(kICNewsAuthPassword, result); };
  46.         ICError GetArchiePrefered(StringPtr result)
  47.             { return GetKeysString(kICArchiePreferred, result); };
  48.         ICError GetUMichPreferred(StringPtr result)
  49.             { return GetKeysString(kICUMichPreferred, result); };
  50.         ICError GetInfoMacPreferred(StringPtr result)
  51.             { return GetKeysString(kICInfoMacPreferred, result); };
  52.         ICError GetPhHost(StringPtr result)
  53.             { return GetKeysString(kICPhHost, result); };
  54.         ICError GetWhoisHost(StringPtr result)
  55.             { return GetKeysString(kICWhoisHost, result); };
  56.         ICError GetFingerHost(StringPtr result)
  57.             { return GetKeysString(kICFingerHost, result); };
  58.         ICError GetFTPHost(StringPtr result)
  59.             { return GetKeysString(kICFTPHost, result); };
  60.         ICError GetTelnetHost(StringPtr result)
  61.             { return GetKeysString(kICTelnetHost, result); };
  62.         ICError GetSMTPHost(StringPtr result)
  63.             { return GetKeysString(kICSMTPHost, result); };
  64.         ICError GetNNTPHost(StringPtr result)
  65.             { return GetKeysString(kICNNTPHost, result); };
  66.         ICError GetGopherHost(StringPtr result)
  67.             { return GetKeysString(kICGopherHost, result); };
  68.         ICError GetLDAPServer(StringPtr result)
  69.             { return GetKeysString(kICLDAPServer, result); };
  70.         ICError GetLDAPSearchbase(StringPtr result)
  71.             { return GetKeysString(kICLDAPSearchbase, result); };
  72.         ICError GetWWWHomePage(StringPtr result)
  73.             { return GetKeysString(kICWWWHomePage, result); };
  74.         ICError GetWAISGateway(StringPtr result)
  75.             { return GetKeysString(kICWAISGateway, result); };
  76.         ICError GetOrganization(StringPtr result)
  77.             { return GetKeysString(kICOrganization, result); };
  78.  
  79.         // key based                
  80.         ICError GetKeysString(ConstStr255Param keyStr, Str255 thePStr);
  81.  
  82.         // font records
  83.         ICError GetListFont(ICFontRecord *fontRecord)
  84.             { return GetFontRecord(kICListFont, fontRecord); };
  85.         ICError GetScreenFont(ICFontRecord *fontRecord)
  86.             { return GetFontRecord(kICScreenFont, fontRecord); };
  87.         ICError GetPrinterFont(ICFontRecord *fontRecord)
  88.             { return GetFontRecord(kICPrinterFont, fontRecord); };
  89.         ICError GetFontRecord(ConstStr255Param keyStr, ICFontRecord *fontRecord);
  90.  
  91.         // File mappings
  92.         ICError MapFilename(StringPtr name, ICMapEntry *entry);
  93.         ICError MapFilename(char *name, ICMapEntry *entry);
  94.         
  95.         ICError StartMapIteration(void);
  96.         Boolean NextMapEntry(ICMapEntry *entry);
  97.         ICError    FinishMapIteration(void);
  98.  
  99.         // editing preferences
  100.         ICError EditPreferences(ConstStr255Param key = "\p");
  101.         
  102.         // Routines to get helper application FSSpec's
  103.         ICError GetEditorHelper(FSSpec *theFileSpec, OSType *creator)
  104.             { return GetHelperFileSpec("\pHelper•editor", theFileSpec, creator); };
  105.         ICError GetFTPHelper(FSSpec *theFileSpec, OSType *creator)
  106.             { return GetHelperFileSpec("\pHelper•fto", theFileSpec, creator); };
  107.         ICError GetNewsHelper(FSSpec *theFileSpec, OSType *creator)
  108.             { return GetHelperFileSpec("\pHelper•nntp", theFileSpec, creator); };
  109.         ICError GetMailHelper(FSSpec *theFileSpec, OSType *creator)
  110.             { return GetHelperFileSpec("\pHelper•mailto", theFileSpec, creator); };
  111.         ICError GetGopherHelper(FSSpec *theFileSpec, OSType *creator)
  112.             { return GetHelperFileSpec("\pHelper•gopher", theFileSpec, creator); };
  113.         ICError GetWebHelper(FSSpec *theFileSpec, OSType *creator)
  114.             { return GetHelperFileSpec("\pHelper•http", theFileSpec, creator); };
  115.         ICError GetFingerHelper(FSSpec *theFileSpec, OSType *creator)
  116.             { return GetHelperFileSpec("\pHelper•finger", theFileSpec, creator); };
  117.         ICError GetTelnetHelper(FSSpec *theFileSpec, OSType *creator)
  118.             { return GetHelperFileSpec("\pHelper•editor", theFileSpec, creator); };
  119.         ICError GetTN3270Helper(FSSpec *theFileSpec, OSType *creator)
  120.             { return GetHelperFileSpec("\pHelper•telnet", theFileSpec, creator); };
  121.         ICError GetWAISHelper(FSSpec *theFileSpec, OSType *creator)
  122.             { return GetHelperFileSpec("\pHelper•tn3270", theFileSpec, creator); };
  123.         ICError GetWhoIsHelper(FSSpec *theFileSpec, OSType *creator)
  124.             { return GetHelperFileSpec("\pHelper•wais", theFileSpec, creator); };
  125.         ICError GetNetPhHelper(FSSpec *theFileSpec, OSType *creator)
  126.             { return GetHelperFileSpec("\pHelper•netphone", theFileSpec, creator); };
  127.         ICError GetXNetPhHelper(FSSpec *theFileSpec, OSType *creator)
  128.             { return GetHelperFileSpec("\pHelper•x-netphone", theFileSpec, creator); };
  129.     
  130.     protected:
  131.         ICError GetHelperFileSpec(StringPtr key, FSSpec *theFileSpec, OSType *creator);
  132.         Boolean LocateApplication(OSType signature, FSSpec *theFileSpec);
  133.  
  134.         ICInstance inst;
  135.         Boolean installed, started;
  136.         Handle mappings;
  137.         long numMappings, currentPos;
  138.         OSType applicationSig;
  139. };
  140.  
  141.  
  142.